{% extends './home/base.html' %}
{% block content %}
    <div class="container clearfix">
        <ul class="list-group list-group-flush float-left col-8">
            {% for item in pagination.items %}
                <li class="list-group-item clearfix">
                    <div class="float-left" onclick="location.href='/que_detail/{{ item.que_id }}'">
                        <h5>{{ item.que_title }}</h5>
                        <div class="mb-2 mt-2">
                            <span class="badge badge-primary badge-pill">{{ item.que_cat.cat_name }}</span>
                        </div>
                          <small class="text-primary">
                            <span>访问次数:{{ item.que_visit_count }}</span>
                            <span class="ml-2">点赞次数:{{ item.que_like_count }}</span>
                        </small>
                        <p class="text-left">{{ item.que_create_time }}</p>
                    </div>
                    <div class="float-right">
                        <img style="width: 120px;" class="img-thumbnail rounded-circle" src="{{ item.que_cover }}"
                             alt="">
                    </div>
                </li>
            {% endfor %}

        </ul>
        <div class="text-center aside alert float-right col-3" style="box-shadow:0 0 2px 0 rgba(0,0,0,.2)">
            <img class="rounded-circle img-thumbnail" src="{{ member_info.mem_avatar }}"
                 onerror="this.src='https://fastly.picsum.photos/id/918/200/200.jpg?hmac=37H802KwXfuowCMLkhelVVH4hV-oKDxm_EqREnD3ETw'"
                 alt="">
            <h1>{{ member_info.mem_nickname }}</h1>
        </div>

    </div>
    {#    分页按钮  #}
    <div class="container">
        <ul class="pagination">
            <li class="page-item disabled">
                <a class="page-link" href="#">总共{{ pagination.total }} 条数据</a>
            </li>
            <li class="page-item disabled">
                <a class="page-link" href="#">当前{{ pagination.page }}/{{ pagination.pages }}页</a>
            </li>

            <li class="page-item {% if not pagination.has_prev %}disabled{% endif %}">
                <a class="page-link" href="/user/{{ member_info.mem_id }}?page={{ pagination.prev_num }}">上一页</a>
            </li>

            {% for item in range(1,pagination.pages + 1 ) %}
                <li class="page-item {% if pagination.page==item %}active{% endif %}">
                    <a class="page-link" href="/user/{{ member_info.mem_id }}?page={{ item }}">{{ item }}</a>
                </li>
            {% endfor %}
            <li class="page-item {% if not pagination.has_next %}disabled{% endif %}">
                <a class="page-link" href="/user/{{ member_info.mem_id }}?page={{ pagination.next_num }}">下一页</a>
            </li>
        </ul>
    </div>


{% endblock %}